<template>
  <div class="aside-box">
    <div class="user">
      <div class="imgbox">
        <img src="../../../../static/images/user.jpg" alt="" />
      </div>
      <div class="name">
        <span>深</span>
      </div>
    </div>
    <div class="list">
      <div class="title">推荐</div>
      <ul>
        <li :class="path == '/' || path == '/home/index' ? 'path_active' : ''">
          <router-link tag="span" to="/home/index">
            <i class="fa fa-eye" aria-hidden="true"></i>
            <i>发现音乐</i>
          </router-link>
        </li>
        <li>
          <i class="iconfont icon-leida"></i>
          <i>私人FM</i>
        </li>
        <!-- <li>
          <i class="iconfont icon-gedan" aria-hidden="true"></i>
          <i>推荐歌单</i>
        </li>
        <li>
          <i class="iconfont icon-paihangbang" aria-hidden="true"></i>
          <i>排行榜</i>
        </li>
        <li>
          <i class="iconfont icon-mv" aria-hidden="true"></i>
          <i>最新MV</i>
        </li> -->
        <li :class="path == '/home/singer' ? 'path_active' : ''">
          <router-link tag="span" to="/home/singer">
            <i class="iconfont icon-geshou" aria-hidden="true"></i>
            <i>热门歌手</i>
          </router-link>
        </li>
      </ul>
      <div class="title">我的音乐</div>
      <ul>
        <li><i class="fa fa-list" aria-hidden="true"></i><i>播放列表</i></li>
        <li>
          <i class="fa fa-folder-open" aria-hidden="true"></i><i>本地歌曲</i>
        </li>
        <li>
          <i class="fa fa-download" aria-hidden="true"></i><i>下载管理</i>
        </li>
      </ul>
      <div class="title">我的歌单</div>
      <ul>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>我喜欢的</i></li>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>夏日忧伤</i></li>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>夏日忧伤</i></li>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>夏日忧伤</i></li>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>夏日忧伤</i></li>
        <li><i class="fa fa-music" aria-hidden="true"></i><i>夏日忧伤</i></li>

        <li>
          <i class="fa fa-music" aria-hidden="true"></i><i>hip-pop专属</i>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      path: "/",
    }
  },
  watch: {
    $route: {
      handler(val, oldval) {
        this.path = val.path
      },
      // 深度观察监听
      deep: true,
    },
  },
}
</script>
<style lang="scss" scoped>
$primary: #409eff;
.aside-box {
  width: 100%;
  height: 100%;
  background: rgb(248, 248, 248);
  .user {
    width: 100%;
    height: 50px;
    display: flex;
    .imgbox {
      width: 60px;
      height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      img {
        height: 40px;
        width: 40px;
        border-radius: 5px;
      }
    }
    .name {
      display: flex;
      align-items: center;
      justify-content: start;
      padding-left: 10px;
    }
  }
  .list {
    height: calc(100% - 115px);
    overflow-y: auto;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
    padding-bottom: 10px;
    .title {
      padding-left: 10px;
      height: 40px;
      line-height: 40px;
      text-align: left;
      margin: 0;
      font-size: 16px;
    }
    ul {
      li {
        padding-left: 30px;
        box-sizing: border-box;
        height: 32px;
        line-height: 32px;
        list-style: none;
        text-align: left;
        transition: 0.5s;
        span {
          display: inline-block;
          width: 100%;
        }
        i {
          font-size: 14px;
          padding-right: 4px;
          font-style: normal;
        }
      }
      li:hover {
        cursor: pointer;
        background: $primary;
        color: white;
      }
    }
  }
}
::-webkit-scrollbar {
  height: 0;
  width: 0;
  color: transparent;
}
.path_active {
  background: $primary;
  color: white;
}
</style>
